import { registerFieldPlugin } from 'sula';
import RadioGroup from './RadioGroup/index';
import RemoteSelect from './RemoteSelect/index';
import FieldsCollapse from './FieldsCollapse';
import DynamicDepFieldComp from './DynamicDepFieldComp/index';
import FormatterInput from './FormatterInput/index';
import EnhancedInput from './EnhancedInput';
import type { FunctionComponent } from 'react';
import EnhancedTextArea from './EnhancedTextArea';
import FormatterSelect from './FormatterSelect';

function registerFieldPlugins() {
  registerFieldPlugin('radioGroupButton')(RadioGroup as any, true);
  registerFieldPlugin('remoteSelect')(RemoteSelect as FunctionComponent, true, true);
  registerFieldPlugin('fieldsCollapse')(FieldsCollapse as FunctionComponent, true, true);
  registerFieldPlugin('formatterInput')(FormatterInput as FunctionComponent, true, true);
  registerFieldPlugin('dynamicdepfieldcomp')(DynamicDepFieldComp);
  registerFieldPlugin('enhancedInput')(EnhancedInput as FunctionComponent, true, true);
  registerFieldPlugin('enhancedTextArea')(EnhancedTextArea as FunctionComponent, true, true);
  registerFieldPlugin('formatterSelect')(FormatterSelect as FunctionComponent, true, true);
}

export {
  RadioGroup,
  RemoteSelect,
  FieldsCollapse,
  DynamicDepFieldComp,
  FormatterInput,
  FormatterSelect,
  registerFieldPlugins,
};

export default registerFieldPlugins;
